from fastapi import FastAPI, HTTPException
from .generate import mock_generate_video

app = FastAPI()

@app.post("/api/create")
async def generate(text: str):
    result = mock_generate_video(text)
    if result["status"] == "error":
        raise HTTPException(status_code=500, detail=result["message"])
    return result

@app.get("/health")
async def health_check():
    return {"status": "OK"}